Class Sudoku

java.lang.Object
edu.uky.ai.csp.kr.Problem
edu.uky.ai.csp.Sudoku

public class Sudoku
extends Problem
Models a Sudoku puzzle as a constraint satisfaction problem.
Author:
Stephen G. Ware
  • Field Summary

    Fields inherited from class edu.uky.ai.csp.kr.Problem

    constraints, variables
  • Constructor Summary

    Constructors 
    Constructor Description
    Sudoku​(java.lang.String initial)
    Constructs a specific puzzle from a string representation.
  • Method Summary

    Modifier and Type Method Description
    Domain getDomain​(java.lang.String variable)  
    java.lang.String toString​(Solution solution)
    Prints a string representation of the a solution (or partial solution) to a Sudoku puzzle.

    Methods inherited from class edu.uky.ai.csp.kr.Problem

    addConstraint, addVariable, getDomain

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Sudoku

      public Sudoku​(java.lang.String initial)
      Constructs a specific puzzle from a string representation.
      Parameters:
      initial - the string describing the initial state of the puzzle
  • Method Details

    • toString

      public java.lang.String toString​(Solution solution)
      Prints a string representation of the a solution (or partial solution) to a Sudoku puzzle.
      Overrides:
      toString in class Problem
      Parameters:
      solution - the solution to be printed
      Returns:
      a string representation of the puzzle
    • getDomain

      public Domain getDomain​(java.lang.String variable)